package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppPersonalCenterMapper;
import com.ruoyi.system.domain.AppPersonalCenter;
import com.ruoyi.system.service.IAppPersonalCenterService;
import com.ruoyi.common.core.text.Convert;

/**
 * 个人应用Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-30
 */
@Service
public class AppPersonalCenterServiceImpl implements IAppPersonalCenterService 
{
    @Autowired
    private AppPersonalCenterMapper appPersonalCenterMapper;

    /**
     * 查询个人应用
     * 
     * @param id 个人应用ID
     * @return 个人应用
     */
    @Override
    public AppPersonalCenter selectAppPersonalCenterById(Long id)
    {
        return appPersonalCenterMapper.selectAppPersonalCenterById(id);
    }

    /**
     * 查询个人应用列表
     * 
     * @param appPersonalCenter 个人应用
     * @return 个人应用
     */
    @Override
    public List<AppPersonalCenter> selectAppPersonalCenterList(AppPersonalCenter appPersonalCenter)
    {
        return appPersonalCenterMapper.selectAppPersonalCenterList(appPersonalCenter);
    }

    /**
     * 新增个人应用
     * 
     * @param appPersonalCenter 个人应用
     * @return 结果
     */
    @Override
    public int insertAppPersonalCenter(AppPersonalCenter appPersonalCenter)
    {
        appPersonalCenter.setCreateTime(DateUtils.getNowDate());
        return appPersonalCenterMapper.insertAppPersonalCenter(appPersonalCenter);
    }

    /**
     * 修改个人应用
     * 
     * @param appPersonalCenter 个人应用
     * @return 结果
     */
    @Override
    public int updateAppPersonalCenter(AppPersonalCenter appPersonalCenter)
    {
        appPersonalCenter.setUpdateTime(DateUtils.getNowDate());
        return appPersonalCenterMapper.updateAppPersonalCenter(appPersonalCenter);
    }

    /**
     * 删除个人应用对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAppPersonalCenterByIds(String ids)
    {
        return appPersonalCenterMapper.deleteAppPersonalCenterByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除个人应用信息
     * 
     * @param id 个人应用ID
     * @return 结果
     */
    @Override
    public int deleteAppPersonalCenterById(Long id)
    {
        return appPersonalCenterMapper.deleteAppPersonalCenterById(id);
    }

    /**
     * 获取app个人中心
     * @return
     */
    @Override
    public List<AppPersonalCenter> getPersonalCenterList() {
        return appPersonalCenterMapper.getPersonalCenterList();
    }
}
